package com.open.capacity.finance.controller;

import com.open.capacity.commons.Result;
import com.open.capacity.finance.entity.SourceBaseAsset;
import com.open.capacity.finance.entity.SourceBaseAssetTotal;
import com.open.capacity.finance.service.SourceBaseAssetService;
import com.open.capacity.finance.service.SourceBaseAssetTotalService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 资产数据大类统计
 *
 * @author 
 * @email 
 * @date 2023-04-20 17:41:35
 */
@RestController
@RequestMapping("sourcebaseassets")
@Api(tags = "资产数据")
public class SourceBaseAssetController {

    @Autowired
    private SourceBaseAssetService sourceBaseAssetService;


    @Autowired
    private SourceBaseAssetTotalService sourceBaseAssetTotalService;

    /**
     * 资产大类分布
     */
    @RequestMapping("/listCategory")
    public Result listCategory(@RequestParam Map<String, Object> params) {
        List<SourceBaseAssetTotal> list = sourceBaseAssetTotalService.findCategorys(params);
        return Result.succeed(list);
    }

    /**
     * 车辆用途分布
     */
    @RequestMapping("/listCarUseway")
    public Result listCarUseway(@RequestParam Map<String, Object> params) {
        List<SourceBaseAsset> list = sourceBaseAssetService.findUseways(params);
        return Result.succeed(list);
    }

}
